UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1X9btoSEl3Fblkld9iZu7BdL6WgJvVBU7+GUIz1kNcM=' 
WHERE 
  key_id = 'cea761bf61a3e6de77a7c249c214bbfb7be85e3f35676f89e92a159bac65bf8e' 
  AND (
    token = '1X9btoSEl3Fblkld9iZu7BdL6WgJvVBU7+GUIz1kNcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040