UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3KIp+InrC/KKfikY1ucK+gNEL+7tETxNg0SvlBZji60='
WHERE
key_id = '36aca149a9b95e4f461019c4c98da41325f004b154805619fd6220a45f39106c'
AND (
token = '3KIp+InrC/KKfikY1ucK+gNEL+7tETxNg0SvlBZji60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)