UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7pgDKIOicJqGlDPdxHMy3/z7TlbQJfPR6+OAesFxGnI='
WHERE
key_id = '692b5cb60d2f1e1df32c6a7048860cd034b65b0bffd710882bc6708ddbc8692e'
AND (
token = '7pgDKIOicJqGlDPdxHMy3/z7TlbQJfPR6+OAesFxGnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)