UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yj/H98QgbiOTNuqYVT+jExbB04P33zCSkEO02R+NrdQ='
WHERE
key_id = '686538d200d167fad5ddcaa6ceae0842df740f35fbd4fb3845ea8afa2b94468e'
AND (
token = 'yj/H98QgbiOTNuqYVT+jExbB04P33zCSkEO02R+NrdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)