UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODQpxSvI29x/5DMF2923yZPZC5uO6Y6QzYVH85vRarQ='
WHERE
key_id = '65f2a47114c35c664085fc763fa99d6f64bdb031565887cbf6f02ba51e35b25b'
AND (
token = 'ODQpxSvI29x/5DMF2923yZPZC5uO6Y6QzYVH85vRarQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)