UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cs3EkgJF0tKbda6fV1HBzQX8ggcBzlf7RCIX0nb/RTI='
WHERE
key_id = '83f99b8a87a9de7e1ef74dd26203bd4748ad225a4ae869b241b75ff39a732e1f'
AND (
token = 'Cs3EkgJF0tKbda6fV1HBzQX8ggcBzlf7RCIX0nb/RTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)