UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0+BArS8dbz1zFM1e6/yek1dhZmuS7XOKLxtw13yz7GU='
WHERE
key_id = '7537407aa6f250c2f69d12aded54549ce872d2986b6f6983a8c91cba5b900561'
AND (
token = '0+BArS8dbz1zFM1e6/yek1dhZmuS7XOKLxtw13yz7GU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)