UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fj1nPzEpHI0kqF0q4AOXMddsXixQYU/Q1ChgO3gcK5o=' 
WHERE 
  key_id = 'dac082b1901ca56592d0532b005eb5bbd6c72a9696ca8f670d5351abd3a51233' 
  AND (
    token = 'fj1nPzEpHI0kqF0q4AOXMddsXixQYU/Q1ChgO3gcK5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015