UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UXSwdpFs4xMc4Ra585I1/q2TwKlBxoq7LGGfk6p6gl4='
WHERE
key_id = '6936b664b80dba6f67b5314e7f5ac856550acfa7279d754b97394e9e836b04bd'
AND (
token = 'UXSwdpFs4xMc4Ra585I1/q2TwKlBxoq7LGGfk6p6gl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)