UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sUjyKFbRpPGg5fDmeNALjsq4xrYSiUuf971gY1jzQOc='
WHERE
key_id = '577d37d83adc9021f2e333dd2f9c8466e79981e755b46a1f9bd2b9edfa73163a'
AND (
token = 'sUjyKFbRpPGg5fDmeNALjsq4xrYSiUuf971gY1jzQOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)