UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T6yGYaebpk3n0CXTiStnBJ8x5inthBTYmR2HbfSnt5g='
WHERE
key_id = '705d7e37141281b48aa7efab56fc057d7a8d2297d85be2b2e637d26fe3190bb4'
AND (
token = 'T6yGYaebpk3n0CXTiStnBJ8x5inthBTYmR2HbfSnt5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)