UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ogg4gNfYW940gXXupa9WD5EjoJglS/Epv9j6gqXTMCU='
WHERE
key_id = '86ebcafff3ef562139e93e9db6883c17e112d013feee306b76b3f27cf2eb06a4'
AND (
token = 'Ogg4gNfYW940gXXupa9WD5EjoJglS/Epv9j6gqXTMCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)