UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7DKGVfHZ/CbfsmW/RZ94W0rzwSQ2EpYqaVaMYYsiK+w=' 
WHERE 
  key_id = '71e45e86d12c5f428a35cd185cad3434d7127c4fff58c9cc2e83eb24aceff55e' 
  AND (
    token = '7DKGVfHZ/CbfsmW/RZ94W0rzwSQ2EpYqaVaMYYsiK+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027