UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUvP1St0QVESdt/zCo6uutfXvf81WuuF2ZtkEzLbwgw='
WHERE
key_id = 'd7fbdb63ee5bf3308ca70100221cb9ab063bfd3b28d5ec6c1066ddc41006b83b'
AND (
token = 'xUvP1St0QVESdt/zCo6uutfXvf81WuuF2ZtkEzLbwgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)