UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tD3/+hjLSr9c1onO6h+Os2O/gW19CaUNECiY8BwfOfo=' 
WHERE 
  key_id = 'ab1fb4c00cbd959a185ebf64536f9b9f90ac10bf04992073860277a4227e0b3d' 
  AND (
    token = 'tD3/+hjLSr9c1onO6h+Os2O/gW19CaUNECiY8BwfOfo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024