UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zFQsWG8PPqAfl+whppgJJqrOOxbxlkSP4eWOpcM8PVE='
WHERE
key_id = '762580e4cd9483868739262b38fa23c53885d2ca9cbe9b631bffe7ce8dad77f5'
AND (
token = 'zFQsWG8PPqAfl+whppgJJqrOOxbxlkSP4eWOpcM8PVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)