UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q4bpYKSe40mxV4WtFxdt5Ov2dEUQ7LDXLqq0F6IjXyI=' 
WHERE 
  key_id = 'b43a5fd584130d200ae73a853e98e83448f8e5d62b8ff24d170ddfddd101c076' 
  AND (
    token = 'Q4bpYKSe40mxV4WtFxdt5Ov2dEUQ7LDXLqq0F6IjXyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025