UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5AGvp9A6Lr/HMkL/3VApH07lqgHhtuK5dUEcYOjCcmo='
WHERE
key_id = '71e002c6316c1ead352b08efc50bdf230ffc19b42ba356c75d2e23b7aeb07834'
AND (
token = '5AGvp9A6Lr/HMkL/3VApH07lqgHhtuK5dUEcYOjCcmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)