UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o9Z67trUzWQKCHOnokxOsLACidxAd7rAHEtt+APLtcs='
WHERE
key_id = 'a5dad75f53ffc28e2fae7a0a52d7e297cbe0e58944f920f94b5a914c73790a4c'
AND (
token = 'o9Z67trUzWQKCHOnokxOsLACidxAd7rAHEtt+APLtcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)