UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'USq2od0yaJ8pE4BNPOxvY13bHXFEhB5JzKpJ9BiPhKs='
WHERE
key_id = '0954931f938a7c3821739f820bcecb28190a90efc2d3cbd928c1c0971c8df8df'
AND (
token = 'USq2od0yaJ8pE4BNPOxvY13bHXFEhB5JzKpJ9BiPhKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)