UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o3mIRx2/3oLQaUTMR9YaYVU5c8C1aaSFbU/UZ1oUhCk='
WHERE
key_id = '143f957494b0dce96b281ca5341afe5cafa72cfa384a1bb5f767412313380ef7'
AND (
token = 'o3mIRx2/3oLQaUTMR9YaYVU5c8C1aaSFbU/UZ1oUhCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)