UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UMNxeJc1AVXYA8GsGAVqKTi9mcXJHdO9wUtoHhfEwsE='
WHERE
key_id = '493020078adc98da573ae5691cf38b94a2797fd777f089b1cecd9655a6d5d02a'
AND (
token = 'UMNxeJc1AVXYA8GsGAVqKTi9mcXJHdO9wUtoHhfEwsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)