UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LP3eGhqJ2u4yY+TPvWlyR6nkIwD8NpHR/ZYx2Auncmo='
WHERE
key_id = 'ff750afbed89ab3f138dd4c8251a3f2caae781c68bb379c5231538a9aeab4fe9'
AND (
token = 'LP3eGhqJ2u4yY+TPvWlyR6nkIwD8NpHR/ZYx2Auncmo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)