UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2/S5Q7F2zSTSxoqZhsYvjDVDTfDTwAVSg+8EpaL0yg4='
WHERE
key_id = '96cc2616bac7ad6f2ecaaabbac8010810f644ce718f7dee0091916985737f0c7'
AND (
token = '2/S5Q7F2zSTSxoqZhsYvjDVDTfDTwAVSg+8EpaL0yg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)