UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PYp5eoo2asVcbdRYqhOehlOBcktHmt2Ixfmc7lrUzJA=' 
WHERE 
  key_id = '28d1d5341337032318937f976aedcfd0c5af71bfb5c36406cd2acf56f90e1c20' 
  AND (
    token = 'PYp5eoo2asVcbdRYqhOehlOBcktHmt2Ixfmc7lrUzJA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018