UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I6mrNohUcyBxW+g59Gu0JgjzrspcsJnvjP6PQVs7C/E='
WHERE
key_id = 'd8012ee44f0b7a5c9a42df4e73ae898b5d4fb4abf3de0f2b09c2c54795c1a725'
AND (
token = 'I6mrNohUcyBxW+g59Gu0JgjzrspcsJnvjP6PQVs7C/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)