UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4y1Ea5MVfsgVoJ8L4vUZyR1Hg3w0BUeCdq1tbI7VimM='
WHERE
key_id = '6eb8b1cd5ff8c7db574b47b190a5a2de0dc6a50813006687f791b58b74f5c433'
AND (
token = '4y1Ea5MVfsgVoJ8L4vUZyR1Hg3w0BUeCdq1tbI7VimM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)