UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kE+zZyex1F8F0Afn6kXbcTpL4+t8cq6NO6r62tL/l4s=' 
WHERE 
  key_id = '94fa4facab75219680c3ff045f757bb738166a6f5401e1b827dbe859850c1367' 
  AND (
    token = 'kE+zZyex1F8F0Afn6kXbcTpL4+t8cq6NO6r62tL/l4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025