UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OibqJpcAVZ6N5bHTGqVsvLQdjhT1ZAidsJ/bhPDJIoE='
WHERE
key_id = 'e5a524e9cb108925e9a0a06949e95a0a241bf72160253e84234c224d7ab3a7c9'
AND (
token = 'OibqJpcAVZ6N5bHTGqVsvLQdjhT1ZAidsJ/bhPDJIoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)