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

Query time 0.00045