UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tDuL2QtWMgDluLLNJ1ODlE+J3vpuvD5JmctJ5UTYNQk=' 
WHERE 
  key_id = 'cd27f6dcc9d40e0092f88d5219da55e1029b904da5012beab257a150aaf66fe0' 
  AND (
    token = 'tDuL2QtWMgDluLLNJ1ODlE+J3vpuvD5JmctJ5UTYNQk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015