UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lU8ctwjOQOflLljWcc7FeJL/7x1+iG/TcRzYOvz5XGo=' 
WHERE 
  key_id = 'f5ebf3007ea99e67ed412ca415ed6d32897d28fd121859f75bd03316a0866da2' 
  AND (
    token = 'lU8ctwjOQOflLljWcc7FeJL/7x1+iG/TcRzYOvz5XGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028