UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MXPa31ImrYciD+zQ1tpQV9qM9GiPVwS1+40LkjvYFlY=' 
WHERE 
  key_id = '4cc99c1473c32bef70c72c0b67144cdcf158836e657db59c002f09bf5a3b459c' 
  AND (
    token = 'MXPa31ImrYciD+zQ1tpQV9qM9GiPVwS1+40LkjvYFlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025