UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2npQUypDV6LjpytHBEHqy6aRCqrqv6kcswB2Arbmcc='
WHERE
key_id = '5c34a2faf0c924b74bef805e6d02b5eba93213168716b78472effd5a3891dcf6'
AND (
token = 'M2npQUypDV6LjpytHBEHqy6aRCqrqv6kcswB2Arbmcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)