UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UBeLfXCzgd/jBQNM/gdVH+yAw7vntmF4RcB40sTliRI='
WHERE
key_id = 'a81026a1de15d55a92eddf14abb1451c60345295a9957c02e5d71f33291b2e4c'
AND (
token = 'UBeLfXCzgd/jBQNM/gdVH+yAw7vntmF4RcB40sTliRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)