UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hcopp0Z3n/kOznif/bp27tgdFGZuEbDthdGVjywsTEI=' 
WHERE 
  key_id = '9dfa1f88efa5234c7530901e1881ed7564dcff9b9a282d2e2f0cef9df08e476d' 
  AND (
    token = 'Hcopp0Z3n/kOznif/bp27tgdFGZuEbDthdGVjywsTEI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026